import server from "../util/request.js";

/**
 * 1. 加载所有可开药品
 * (调用 DrugController.java)
 */
export function loadAllDrugs() {
    return server({
        url: '/drug', // GET /drug
        method: 'get'
    })
}

/**
 * 2. 批量提交
 */
export function submitPrescription(data) {
    return server({
        url: '/api/prescription/create',
        method: 'post',
        data: data
    })
}

/**
 * 3. 根据患者ID加载所有药
 */
export function loadPatientPrescriptions(patientId){
    return server({
        url: `/api/prescription/history/${patientId}`,
        method: 'get'
    })
}